package cn.jly.boot.mp.custom_actuator.info;

import org.springframework.boot.actuate.info.Info;
import org.springframework.boot.actuate.info.InfoContributor;
import org.springframework.stereotype.Component;

import java.util.Collections;

/**
 * 访问
 * http://localhost:8080/actuator/info
 *
 * @PackageName cn.jly.boot.mp.custom_actuator.info
 * @ClassName MyInfoInfoContributor
 * @Description 自定义应用监控的info信息，与配置文件中取并集
 * @Author 姬岚洋
 * @Date 2021/1/24 下午 4:51
 */
@Component
public class MyInfoInfoContributor implements InfoContributor {
    @Override
    public void contribute(Info.Builder builder) {
        builder.withDetail("name", "lanyangji")
                .withDetails(Collections.singletonMap("age", 23));
    }
}
